﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;
using Elentok.Common;
using Elentok.Common.Helpers;

namespace AMail.Modules.Data.Unittests.Mocks
{
  public static class EmailMocks
  {
    public const string DemoEmailNameFormat = "AMailLib.Unittests.Mocks.{0}.eml";

    private static EmailMock email1;

    public static EmailMock Email1
    {
      get
      {
        if (email1 == null)
          email1 = new EmailMock
          {
            Source = GetDemoEmail("Email1"),
            Subject = "9 Things to Do When You Inherit a Database (SQLServerCentral.com 2/26/2010)"
          };

        return email1;
      }
    }


    public static byte[] GetDemoEmail(string name)
    {
      string fullname = string.Format(DemoEmailNameFormat, name);
      return Assembly.GetExecutingAssembly().GetManifestResourceBytes(fullname);
    }
  }

  public class EmailMock
  {
    public byte[] Source { get; set; }
    public string Subject { get; set; }
  }

}
